package xin.nick.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController implements UserRemoteClient {

    Logger logger = LoggerFactory.getLogger(DemoController.class);

    @Override
    public String getName() {
        return "Nick";
    }

    @Override
    public String getUseInfo(String name, Integer age) {
        logger.info(name + "--" + age);
        return new UserInfo(name, age).toString();
    }

    @Override
    public String addUser(@RequestBody UserInfo userInfo) {
        logger.info(userInfo.toString());
        return userInfo.toString();
    }
}
